Wrap a List Control in a Window Container.

Description

You can use a window container to display a list control filled with data generated from an SQL database. The list control can also be easily formated using pre-defined templates.

A list in a window displaying a SQL table from a server-side database.
A list in a window displaying a SQL table from a server-side database.
  1. In the UX Builder on the UX Controls page open the 'Data Controls' menu. Click on the [List] option to add a list control to the component.

    Wlc2
  2. Highlight the list control in the controls tree. In the property list on the right scroll down to the List Properties section and click the [...] button next to the 'List properties' property to open the list builder.

    Wlc3
  3. On the List Builder's 'Data Source' pane, select 'SQL' in the 'Data Source Type' menu.

    Wlc4
  4. Click the [...] button next to the 'Connection string' property in the 'SQL Data Source' section of the properties shown on the 'Data Source' pane.

    Wlc5
  5. Select or create a connection string to the 'Northwind' database. Click OK to return to the Data Source pane.

    Wlc6
  6. Click the [...] button next to the 'Table name' property and select the 'Customers' table.

    Wlc7
  7. Click the [...] button next to the 'Field list' property. Check the 'ContactName', 'City', 'Country, 'CompanyName', and 'CustomerID' field checkboxes.

    Wlc8
  8. Open the 'List Properties' pane. Scroll down the list to the 'Layout Properties' section. Click the dropdown next to the 'Layout type' property and select the 'Freeform' option.

    Wlc9
  9. Open the 'List Layout' pane. The pane should appear in free-form mode. Click the 'Pre-defined Templates' hyperlink at the bottom of the pane.

    Wlc10
  10. A list of possible templates will appear. Select the first option from the list and click OK.

    Wlc11
  11. A 'Map Template Placeholders' dialog will appear. Click the dropdown next to the [[Context]] placeholder and set it to be {CustomerID}.

    Wlc12
  12. Assign the remaining placeholders. Set [[Level1]] to the {ContactName} placeholder, [[Level2]] to the {CompanyName} placeholder, [[Summary]] to the {Country} placeholder, and [[Detail]] to the {City} placeholder. Click OK and OK again to close the List Builder.

    Wlc13
  13. With the list control still highlighted in the controls tree open the 'Containers' menu and click on the [Container] option.

    Wlc14
  14. From the 'Container Type' list select the 'Window' option and click the 'Insert Around' button.

    Wlc15
  15. Highlight the opening window tag in the controls tree, '[Window:WINDOW_1]'. In the properties list click the [...] button next to the 'Window proeprties' property in the Window Properties section.

    Wlc16
  16. In the Window Container dialog set the 'Window type' to be 'Dropdown'.

    Wlc17
  17. Click the [...] button next to the 'Dropdown Window position' property and set it to 'Relative'

    Wlc27
  18. Uncheck the 'Window title show' checkbox.

    Wlc18
  19. Set the 'Window height' and 'Window width' properties to 3in and uncheck the 'Window is resizable' checkbox.

    Wlc19
  20. Check the 'Has pointer icon' checkbox and click OK to close the Window Container dialog.

    Wlc28
  21. Highlight the list control again and again scroll down to the 'List Properties' section. Check the 'Fill container' checkbox.

    Wlc20
  22. Highlight the [Window End: WINDOW_1] tag in the controls tree. Open the 'Defined Controls' menu and click the [Button] option to add a button control to the component.

    Wlc21
  23. Highlight the button control. In the button's properties list on the right set the 'Button text' to read 'Customers'.

    Wlc22
  24. Scroll down the properties list to the 'Javascript' section and click the [...] button next to the 'onClick' property.

    Wlc23
  25. In the 'Edit onClick Event' dialog set the editing mode to 'Action Javascript'. Click the 'Add New Action' button.

    Wlc24
  26. The 'Select and Action' dialog will open. Type 'Show' into the filter list and then select the 'Show Container Window' action. Click OK

    Wlc25
  27. Click the dropdown next to the 'Container ID' property and select the window container you previously defined, 'WINDOW_1'. Click OK, OK, and 'Save'

    Wlc26
  28. Run the component in live preview and click the 'Customers' button. The list control should be displayed.

    Wlc29

See Also